package hngc.com;

import java.util.Scanner;

public class Box4 {
    public static void main(String[] args) {
        int x = 0;
        int y = 0;
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入x的值");
        System.out.println("请输入y的值");
        while (scanner.hasNext()) {
            try {
                x = scanner.nextInt();
                y = scanner.nextInt();
                break;
            } catch (Exception e) {
                System.out.println("输入不符合要求");
                return;
            }
        }
        if (x <= 0 || y <= 0) {
            System.out.println("输入不符合要求");
        } else if (x == y) {
            System.out.println("可以构建圆形或正方形");
        } else if (2 < Math.abs(x - y) && Math.abs(x - y) <= 5) {
            System.out.println("可以构建椭圆");
        } else if (0 < Math.abs(x - y) && Math.abs(x - y) <= 2) {
            System.out.println("可以构建长方形");
        }
        scanner.close();
    }
}
